#读取data里面的数据
import  pandas
import os
class PandasData(object):
    #拼接数据文件的路径
    def __init__(self,your_filename):
        data_path=os.path.dirname(os.path.dirname(__file__))+f"/data{your_filename}"
    #获取文件
        self.table=pandas.read_excel(data_path)
    #将数据转为列表套字典
    def pandas_to_dict(self):
        list_data = []
        for i in self.table.index.values:
            list_data.append(self.table.loc[i].to_dict())
        return  list_data

if __name__ == '__main__':
    p1=PandasData('./add_addr_data.xls')
    print(p1.pandas_to_dict())

